package com.dimples.dd.system.model.form;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;

@Schema(description = "菜单表单对象")
@Data
public class MenuForm {

    @Schema(description = "菜单ID", example = "1024")
    private Long id;

    @Schema(description = "父菜单 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @NotNull(message = "父菜单 ID 不能为空")
    private Long parentId;

    @Schema(description = "菜单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "系统管理")
    @NotBlank(message = "菜单名称不能为空")
    @Size(max = 50, message = "菜单名称长度不能超过50个字符")
    private String menuName;

    @Schema(description = "权限标识,仅菜单类型为按钮时，才需要传递", example = "sys:menu:add")
    @Size(max = 100)
    private String permission;

    @Schema(description = "菜单类型(1-目录；2-菜单；3-外链；4-按钮权限)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "菜单类型不能为空")
    private Integer menuType;

    @Schema(description = "排序(数字越小排名越靠前)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @NotNull(message = "显示顺序不能为空")
    private Integer sort;

    @Schema(description = "菜单图标,仅菜单类型为菜单或者目录时，才需要传", example = "ant-design:align-left-outlined")
    private String icon;

    @Schema(description = "菜单图标(1:iconify;2:local)", example = "1")
    private Integer iconType;

    @Schema(description = "组件路径(vue页面所在的目录，默认为index.vue),仅菜单类型为菜单时，才需要传", example = "system/post")
    @Size(max = 200, message = "组件路径不能超过255个字符")
    private String component;

    @Schema(description = "路由名称", example = "SystemUser")
    private String routeName;

    @Schema(description = "路由地址,仅菜单类型为菜单或者目录时，才需要传", example = "/menu/list")
    @Size(max = 200, message = "路由地址不能超过200个字符")
    private String routePath;

    @Schema(description = "外链", example = "https://baidu.com")
    private String href;

    @Schema(description = "外链打开方式(1:内部窗口打开;2:浏览器窗口打开)", example = "1")
    private Integer hrefOpenType;

    @Schema(description = "状态,见 CommonStatusEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "状态不能为空")
    private Integer status;

    @Schema(description = "i18nKey", example = "route.function")
    private String i18nKey;

    @Schema(description = "显示状态(false:显示;true:隐藏)")
    private Boolean hideInMenu;

    @Schema(description = "进入该路由时激活的菜单键")
    private String activeMenu;

    @Schema(description = "跳转路径")
    private String redirect;

    @Schema(description = "【菜单】是否开启页面缓存", example = "true")
    private Boolean keepAlive;

    @Schema(description = "【目录】只有一个子路由是否始终显示", example = "true")
    private Boolean alwaysShow;

    @Schema(description = "是否为常量路由", example = "true")
    private Boolean constant;

    @Schema(description = "支持多页签", example = "true")
    private Boolean multiTab;

    @Schema(description = "固定在页签中的序号", example = "1")
    private Integer fixedIndexInTab;

}
